//
//  ChatEmptyView.m
//  YMRTC
//
//  Created by admin on 2022/4/19.
//

#import "ChatEmptyView.h"
#import <Masonry/Masonry.h>
@implementation ChatEmptyView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        [self commitInit];
        
    }
    
    return self;
}
-(void)commitInit{
    
   
    [self addSubview:self.emptyImageView];
    [self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
    
        make.centerY.mas_equalTo(self.mas_centerY);
        make.centerX.mas_equalTo(self.mas_centerX);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(100);
    
    }];
  
    [self addSubview:self.emptyLabel];
    [self.emptyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    
         make.top.mas_equalTo(self.emptyImageView.mas_bottom).offset(5);
         make.centerX.mas_equalTo(self.mas_centerX);
    
    }];
}
-(UILabel *)emptyLabel{
    
    if (_emptyLabel == nil) {
        _emptyLabel = [[UILabel alloc] init];
        _emptyLabel.text = @"暂无消息";
       [_emptyLabel setFont:[UIFont systemFontOfSize:14]];
       [_emptyLabel setTextColor:[UIColor lightGrayColor]];
        _emptyLabel.textAlignment = NSTextAlignmentCenter;
    
    }
    
    return _emptyLabel;
}

-(UIImageView *)emptyImageView{
    
    if (_emptyImageView ==  nil) {
        
        _emptyImageView = [[UIImageView alloc]init];
        [_emptyImageView setImage:[UIImage imageNamed:@"Chat_Null"]];
    }
    
    return _emptyImageView;
}
@end
